home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol F-12
/
(Vol F-12) Jun 02 2012.iso
/
Screensaver
/
screensaver_installer.exe
/
____swmx
/
scripts
/
frame_1
/
DoAction_3.as
< prev
next >
Wrap
Text File
|
2004-10-21
|
6KB
|
226 lines
_global.ScreenweaverEvents = function()
{
ASBroadcaster.initialize(this);
};
ScreenweaverEvents.prototype.init = function()
{
if(this.__initialized != undefined)
{
return undefined;
}
swInterface.setEventListener("WindowGeneric",this.onWindowGeneric);
swInterface.setEventListener("SystemGeneric",this.onSystemGeneric);
this.__initialized = true;
};
ScreenweaverEvents.prototype.onWindowGeneric = function()
{
var bForward = true;
if(swEvents[arguments[0]] != undefined)
{
bForward = swEvents[arguments[0]].apply(this,arguments) != undefined;
}
if(bForward)
{
swEvents.broadcastMessage.apply(swEvents,arguments);
}
};
ScreenweaverEvents.prototype.onSystemGeneric = function()
{
var bForward = true;
if(swEvents[arguments[0]] != undefined)
{
bForward = swEvents[arguments[0]].apply(this,arguments) != undefined;
}
if(bForward)
{
swEvents.broadcastMessage.apply(swEvents,arguments);
}
};
ScreenweaverEvents.prototype.onWindowActivate = function(inactiveHandle, inactiveId)
{
swWindow.Data.active = true;
swApplication.Data.activeWindowId = swWindow.getWindowId();
swApplication.Data.activeWindowHandle = swWindow.getWindowHandle();
return arguments;
};
ScreenweaverEvents.prototype.onWindowDeactivate = function(activeHandle, activeId)
{
swWindow.Data.active = false;
swApplication.Data.activeWindowId = activeId;
swApplication.Data.activeWindowHandle = activeWindowHandle;
return arguments;
};
ScreenweaverEvents.prototype.onGlobalMouseMove = function()
{
arguments.unshift("onGlobalMouseMove");
swEvents.broadcastMessage.apply(swEvents,arguments);
};
ScreenweaverEvents.prototype.onWindowShow = function()
{
swWindow.data.visible = true;
return arguments;
};
ScreenweaverEvents.prototype.onWindowHide = function()
{
swWindow.data.visible = false;
return arguments;
};
ScreenweaverEvents.prototype.onWindowData = function()
{
if(arguments[1].__sw_rmc == 1)
{
var args = arguments[1];
var pMethod = _root;
var iStart = 0;
var iStop = args.method.indexOf(".");
var bFirst = true;
while(iStop != -1 && pMethod != undefined)
{
pMethod = pMethod[args.method.substr(iStart,iStop - iStart)];
if(pMethod == undefined && bFirst)
{
pMethod = _global[args.method.substr(iStart,iStop - iStart)];
}
bFirst = false;
iStart = iStop + 1;
iStop = args.method.indexOf(".",iStart);
}
if(pMethod != undefined)
{
pMethod = pMethod[args.method.substr(iStart,args.method.length - iStart)];
if(pMethod != undefined)
{
pMethod.apply(_root,args.args);
}
}
else
{
swDebug.trace("method is undefined");
}
return undefined;
}
return arguments;
};
ScreenweaverEvents.prototype.onWindowMove = function(name, x, y, clientx, clienty)
{
swWindow.data.x = x;
swWindow.data.y = y;
swWindow.data.clientx = clientx;
swWindow.data.clienty = clienty;
return arguments;
};
ScreenweaverEvents.prototype.onWindowSize = function(name, cx, cy, clientcx, clientcy)
{
swWindow.data.cx = cx;
swWindow.data.cy = cy;
return arguments;
};
ScreenweaverEvents.prototype.onWindowExitMove = function(name, x, y)
{
swWindow.data.x = x;
swWindow.data.y = y;
return arguments;
};
ScreenweaverEvents.prototype.onWindowExitSize = function(name, cx, cy)
{
swWindow.data.cx = cx;
swWindow.data.cy = cy;
return arguments;
};
ScreenweaverEvents.prototype.onSysColorChange = function(name, newColors)
{
swSystem.data.Colors = newColors;
arguments.pop();
return arguments;
};
ScreenweaverEvents.prototype.onCtrlV = function(name, data)
{
if(swWindow.CtrlV)
{
field = eval(Selection.getFocus());
if(field instanceof TextField)
{
field.replaceSel(data);
field.broadcastMessage("onChanged",field);
}
}
return arguments;
};
ScreenweaverEvents.prototype.onCtrlC = function()
{
if(swWindow.CtrlC)
{
field = eval(Selection.getFocus());
if(field instanceof TextField)
{
var iBeginIndex = Selection.getBeginIndex();
var iLength = field.text.length;
getURL("FSCommand:sw_setClipboardText",field.text.substr(iBeginIndex,iLength - (iLength - Selection.getEndIndex()) - iBeginIndex));
}
}
return arguments;
};
ScreenweaverEvents.prototype.onCtrlA = function()
{
if(swWindow.CtrlA)
{
field = eval(Selection.getFocus());
if(field instanceof TextField)
{
Selection.setSelection(0,field.text.length);
}
}
return arguments;
};
ScreenweaverEvents.prototype.onCtrlX = function()
{
if(swWindow.CtrlX)
{
field = eval(Selection.getFocus());
if(field instanceof TextField)
{
var iBeginIndex = Selection.getBeginIndex();
var iLength = field.text.length;
var iCaret = Selection.getCaretIndex();
getURL("FSCommand:sw_setClipboardText",field.text.substr(iBeginIndex,iLength - (iLength - Selection.getEndIndex()) - iBeginIndex));
field.text = field.text.substr(0,iBeginIndex) + field.text.slice(Selection.getEndIndex(),length);
Selection.setSelection(iCaret,iCaret);
field.broadcastMessage("onChanged",field);
}
}
return arguments;
};
ScreenweaverEvents.prototype.trackWindowSize = function(bValue)
{
if(bValue)
{
swInterface.setEventListener("WindowSize",swEvents.onWindowSize);
}
else
{
swInterface.clearEventListener("WindowSize");
}
};
ScreenweaverEvents.prototype.trackWindowMove = function(bValue)
{
if(bValue)
{
swInterface.setEventListener("WindowMove",swEvents.onWindowMove);
}
else
{
swInterface.clearEventListener("WindowMove");
}
};
ScreenweaverEvents.prototype.trackGlobalMouse = function(bValue)
{
if(bValue)
{
swInterface.setEventListener("MouseMove",swEvents.onGlobalMouseMove);
}
else
{
swInterface.clearEventListener("MouseMove");
}
};